some progress, lots of debug stuff in there now