Solved problem reported

see #27 

todo 
- [ ] fixed bug
- [ ] more unit tests