added debug statements.