added matplotlib inline and explicit imports to ch5, 6, 7