Understanding function input and output