rejigged for readability, sanity