changed argument order of addResult to better handle empty values