for CS 545 homework