Fixed code according to conventions and added 'use strict' statement.