You should declare `output` before declaring a function that uses it.