added functions and notes to recursive-railway program
added callback to the recursive-railway program
callback is recursive