WOkring on dealing with rails, still some more conditionals to do