solved gradebook problem (Javascript)