messing around with scope in JS