updating with corrected error with variable names