Added comments and corrected the formatting