Move a bunch of code into a block to make it clear which variables are only used...