Changed some variable names and spelling.