Changed some variable treatment