finished coding basic function: being able to analyze directory and save as file