Added function for tracking in multipoles and example