return end result from function