a gnome sort implementation in swift