Added the proper scoping stuff