Added magnetometer (bugs still there)