added debug printstatements