updated waste function