ENH: added error checking
ENH: added customization of the output name