javascript: added print function