bugfix

fixes #69
- algorithm was wrong