Code for CS472