adapted to use new 'main' survey, removed cruft, fixes #18