add sum and dist2_to_box methods