Working version from Min
Fan's version

According to Fan Yang, this version suddenly stopped working. However
except for some x/y ranges, nothing else had been changed.