Finished product

Checks for both test cases