first versions of assignment 4.2 and assignment 5.1