solve assignment 4