changes name and adds logic for routes