Cleaned up the code I wrote