Fixed findRoot and cleaned up.