locate functions automatically