made IO code more robust; added verbose output for directory creation