Added more test cases and started some improvements