Homework 4 of CS333