Changed print output to state based.