Should first check to see if grades is empty, if not, proceed.