fixes #11 and fixes #13