this was somewhat hard to grok w/ all the nested case statements. maybe pull out part into something like `prepare_coord_put`?