code for train