slight modification to lab 3