Added p_clean_dir function