rewrote in rails instead of sinatra, with persistence