Added some test cases, seems to be working so far