POS2 - A simple ticket algorithm