minor formatting fix
minor speed improvements
major speed improvement: improving cache hits