updated print code