works except for numbers ending in 7, 6, 2, 1