fixed lab3 bug