CS271 homework