Cleaned up Code - Solved on CodeEval