Submitted as Assignment 5