updating results function