fixes #13 and fixes #12