added half-hearted debugging stuff