change prints to log, add overwrite option, add template mismatch warning