extended print function