fixed the kx integral bug. Near field needs to be checked