final version of CMPSCI 585 homework #1 source code