minor changes to print and handle the maximum prescrived length in the test cases