nearest 50 version
improved locality of precalulation