Added use strict directive and code cleanup