Speed improvement to numbers solver