The algorithm took the teachers' recommended grades and used them only to rank the students at that school. The actual grades were calculated based on past years' performance for each school. So if you were the top performer at a low-ranking school, your grade would be in line with top performers at that school in previous years.