moved linenum_calc to scripts