Passes all tests, cleaning up the code right now