Added simplifications to lab4