huge simplification of printItems logic that also fixes an edge-case bug.