These code were written for PQS course in Spring 2014.