updated lab4 with additional code, code fix