closes #72. parts of issue 74 as well