Created a route function