Updated app to implement Chris Re's algorithm.