moving finaloutput into anonymous function