cleaned up code, preparation for lab4