Better draw detection algorithm