combines logic for parsing position and speed arrays into one file