Minor QA fix: the function definition should be `function($val) {`. Looks great otherwise.