Exercise 4.1 (integrity check)