Issue36

Was an attempt to use branch just for issue 36 but not quite worked, please merge in both pull requests so I can work with a clean sheet.