redesigned format of print function