Added more features along with some test cases.