made refinements to print conversion and added a test