fixes #15
fixes #12 and #16