chapter 13 exercises. exercise4 still not complete, aka is segfaults