code for final project in CS296