Added resultsfunction with results function