adding sort array helper.