Changes after comparing to GMI code
More changes after comparision with files in GMI.