Code from CS303 @ William and Mary