update for better variable handling
fix issues with variable names