Done as a project for course 15-440 ( http://www.andrew.cmu.edu/course/15-440-s13/index/labs_index.html )