made into a gem
cleaned up ruby