var hoisting and tidy up