Finished logic of positioning the routes.
Still need to improve it though...