converted GetGPA to scalar function