added graded test cases. set output to file according to reqs