fixed a bug with the values of g
and the accln function with scale1 and scle2 included to control the checkbox of the M1 and M2