added averaging before search to remove noise