This is my assignment 2 submission for CEP 2014.