improved force calculation subroutine. faster calculation