Modified to make it controllable by a single var.