modify addRoute

Move parameters into separate lines.
Combine and restructure if else statement.
modify function getPositionOfExistingRoute

move parameters into separate lines.