print function and test changes, as suggested

some other minor tweaks too.