add debug; fix various bugs; avoid double-checking in fanOutFrom();