added test for calc_hgrid
added func calc_hgrid
added draw_hgrid function
some tests added
corrected calc_type