Cleaning up the code and adding TO-DOs