fixed bugs, added test cases, modified gitignore