Made lots of the code work