Updated comments and did minor formatting