Changed some variables to be final.