compsci 340 assignment2