implementing aproper print function