updated particle tracking routine, just need to update how residual is calculated