This is his original version with a binary rmdir() we might need in the future. I will commit an update version with cleanups shortly.