apply functions updated