Updated the waste function