modified print code