converted the def bt back to a val since we are using the new backtrack trick