added read binary;
reference x, y as last point of trajectory instead of the mean point