Modify gridding to group by relation to course