- added testcases
- minor code improvements