add chapter 3, nearest neighbour stuff