Tidied up the code and modified heuristic

Put in more spaces so the code is more readable, and made the heuristic
a "longest first" instead, as this is more in-line with how you'd
schedule an actual workout