Actually use sorted result. Fixes #197
Use modern ObjC syntax