suggested changes from Mark Lowe @ Portcullis