Validation added

at the end of chapter 7