fixing variable words & undefined problems