hw4 completed, simplifications still needed