Reformatted the code- few small changes