this would be easier if i had rails