project 5, revised version for project 4