areSame function added, small changes for better minification