altered the ga function