ring_app example: fancier logic