Changed command F to try recursive fill method and rescue a stack overflow to use non-recursive method