Working version, now attempting to allow user control of format