A chainage calculation system for calculating the chainage distance using Positive Train Control, PTC, messages, the system comprising: means for receiving a PTC Current Position message and a PTC Train Route message; means for comparing an existing linked list with data received in the PTC Train Route message to determine matches between the PTC Train Route message and the linked list if it is determined that the received PTC Train Route message is not a first PTC Train Route message received and a last direction of travel for the train is known; means for adding or deleting nodes of the existing linked list based on the comparison of the existing linked list with the data received in the PTC Train Route message to produce an updated linked list; means for deleting a linked list, calculating the updated linked list and re-originating chainage distance calculation if the received PTC Train Route message is the first PTC Train Route message received, the PTC Train Route message is not the first PTC Train Route message but the last direction of travel for the train is not known, or it is determined that the PTC Train Route message does not include any matches to the existing linked list, means for re-originating chainage distance calculation based on the determination performed by the means for comparing, wherein the re-origination of chainage distance calculation is optionally omitted based on the determination of the means for comparing, and means for utilizing data included in the received PTC Current Position message to determine a last direction of travel for the train if possible, and for calculating the chainage distance based on the result of the latest re-origination of the chainage distance calculation if the last direction of travel for the train has been determined from the received PTC Current Position message. means for receiving a PTC Current Position message and a PTC Train Route message; means for comparing an existing linked list with data received in the PTC Train Route message to determine matches between the PTC Train Route message and the linked list if it is determined that the received PTC Train Route message is not a first PTC Train Route message received and a last direction of travel for the train is known; means for adding or deleting nodes of the existing linked list based on the comparison of the existing linked list with the data received in the PTC Train Route message to produce an updated linked list; means for deleting a linked list, calculating the updated linked list and re-originating chainage distance calculation if the received PTC Train Route message is the first PTC Train Route message received, the PTC Train Route message is not the first PTC Train Route message but the last direction of travel for the train is not known, or it is determined that the PTC Train Route message does not include any matches to the existing linked list, means for re-originating chainage distance calculation based on the determination performed by the means for comparing, wherein the re-origination of chainage distance calculation is optionally omitted based on the determination of the means for comparing, and means for utilizing data included in the received PTC Current Position message to determine a last direction of travel for the train if possible, and for calculating the chainage distance based on the result of the latest re-origination of the chainage distance calculation if the last direction of travel for the train has been determined from the received PTC Current Position message.