changed the place of the method and added test file