first draft of code for routing and move