fix #2, also remove some unused var.