Added automatic calculation of roots