completed makeFile method