code from by rosemarybeetle for Fortune Teller apparatus