Thanks to Marc Banyard, here are some improvements