Ta changes

The changes suggested by our TA. Also added in a new test case.