Variable scoping, eek!