Added comments and removed unnecessary stuff