Created methods and fixed bug caused by deleting 'waste' array