this resolves #9 and also fixes #6