obtain input through call-by-reference