some variables get reused, so calculate place-specific stuff last