bug when sampling with floating point x,y when they should be integers instead