assignment-4 of DI2