single precision and minor optimization