array sorted correctly