re-write as a rails app for a more full example.