made radial basis function faster