Train detection first version