resolves #20. Lead to a bug, so had to fix early!