add boilerplate , copyright information , style up code, remove unesasary comments , did't cheack the working state