This is the evaluation code I have writen for learning.