Updated search method and added model functions