this fixes #16 fixes #13 fixes #15