fixes #4 & fixes #5 - drying but still needs more tests