Added file copying, and test flag