Fixes #22
fixes #23 and fixes #24