integer array sorting functions