- added testcase
- code simplifications