revision of assignment 3