Scoping inside functions now works