Resolves #89 - with thanks to nolar