correct errors in assignment4