Updated script in support of leveling

Adding namespace function toward all level, and added the ability to do
nested declaration