change root to int if error checking is enabled