more sync and debug stuff, bugfix in findgoodphoton