Speedups and memory leak fixes to students report