Reformatted code and removed unnecessary commented code