Added lexical scoping