start of printing boxes to stdout and some small bug fixes