Added megnetometer data handling