this 'if' could be extended, e.g. checking if we are printing, or simply check if z=0, or we could check this in serialConnection instead