changed var binding lookup code to avoid loops