The last handle wasn't corrected, also, there is no reason to flip the handles while sorting (checking the same handles many times) move this into it's own loop.
The last handle wasn't corrected, also, there is no reason to flip the handles while sorting (checking the same handles many times) move this into it's own loop.