inline two functions.
rewrite low-level structure. work in progress.