Making some changes to hook this up with Rails