More discussion on ex6
Add code for ex7