Added code to record acceleration in x and y components