done all test cases alg assignment 3