Cleaned up code, submission earns 7/9 correct, 2 time outs