fixes #158
first version of #157