Rewrite sample_app code for preliminary Five Fox app