Fixed up lab5.cpp