issue #89 + tests