fixes #17, #16, #15