Reformatted the code a bit