Packaged as a ruby gem and made some improvements