Corrected the gm4 and gm8 functions to recursive calls.