Refactored to remove insane reverse array code.
Refactor to make more readable
Add TODO