Added states to route and simplified some things.