changed to short/float for performance