removing unix dep.
rewritten purge to fix the (!!) problem.