Well, you are using eval(), not Number(). You don't seem to understand the forms.
That refers to the first form. When naming it, grades, you don't need it. You really are confused:
I haven't got time to test this, but I think the last two codes posted of mine should help.