Added code for calculating GPA