replaced ES5 array methods for IE7 and 8 compatibility