fixed preprocess, going to look at the variables array a bit more