some changes got lost.
removed unused var.