local function moved to init--> unfinished