ported to rails app