remove excessive whitespace
var scope the variables to make it thread safe.