Reformatted the code/made some small changes