Moved the goal value to search algorithm

letting the search algorithm define the goal value because it made no
sense for the tree to do it