Added functionality for writeTcx