Added check for repeating roots