first run at implementing train