modified the problem when children_size is zero and we are deviding by 0