Changed more variable names to match globals