minor code fixes.
Added variable binding.