IMS #calc_a modification added