moved the search method into the Magic class