Code for CS 160 project