implemetned with closure