using codes for grades, adding some styling aand some sorting