bug fix for method div_by_2