inference about inference helper functions and tinkering to get code blocks in order