clear directory function added
some coments added into the code