modified lab2 ex3 after corrections to test cases