minor changes; more logging