Major Updates to the script, like correcting tranformation and addig G-calibration.