working on roots function