Code tidy, variable names changed