added functional searching