added more tests, fixed bugs, updated test structure