adding router function
renamed to router