some debugging and test code, with date implemented and tested