Added some hoisting code