Added root calculation