first draft of chap5
first try to build a real application