fixes #11
fixes #22
fixed #20