Added use strict and fixed syntax errors