started assignment 4, code from book broken