this fixes #3

added all the necessary test cases.