this fixes #15 and # 16