added element param to formatResult and createSearchChoice function