enhance main print function