revamped file copying, and exception catching