draft input/output generating function created