finish print function and works well :)