Meaningless style improvements

Use inplace sort where possible, use zip instead of enumerate, extend instead of append in a loop