Added scoping and local variables on stack