added array compare function