Final code of CS 207 Project