trying to calculate distance using linear acceleration