fixed array compare function