Adding the tests and Improving somethings