changes to search code - now using generator for searching (next only yet)