Added use strict and fixed var declaration