Made it a gem and fixed some things