some debugging stuff added, we *need* tests!