chap5 main done