added print function for debugging