Early working version of trainMonitor