added solution for Ch6 exercise
updated the constructor code for Ch6 exercise