fixes #17 and fixes #18