Candy Distribution with functional approch