route following function written