lab5 Final Version