finished Stage III, IV, and added check_grades function