Code for IIT's CS546