Improved setRouting() method.

I've improved this method by defining the three variables before the if statements, thus removing the need to set them in the else statements.