Made it so it now works again!

For some reason this gem didn't work for me. These are some changes I made to make it work. I went ahead and cleaned up some code while I was at it.