Cleaning up lab 3 code