How can I get multiple output from a function?