renamed to mkpath, added test