added print function and fix later.