Added consideration of return as a local variable