Finished first two steps of Project 4.
Calculating emat.