Finished fist version of doHkpg with BarrelFrames. Fixed rec_i in doMag