finish to develop routing func