Added test cases. Tested program.