added print code for debugging