Cash Machine Algorithm