added outName and overWrite parameters along with some simple checks