Reformatted the code to make it look more organized.