start of save to gradebook code