add retrospection code from lecture #4