moved debug statements