#40 implemented and tested
fixes and closes #40