Finished #5,6,7

some changes and completion of a lot of work.