added print statments to help debugging