strip_root function + unit tests