first attempt at complex scopes