added -o option to avoid overwrite problems