Added the returned values segment and the final output