Define output variable in correct place