lab 11 modified for problem set 5