fixed missing/incorrect variables names and  typos