Added better scoping.