Move variable definitions - scoping issues?