add result function, not used yet.