Added comments and formating