Looks sane, just one minor coding style nitpick: the MW convention is to have no space between the exclamation mark and the variable name, but I can fix that later on.