first stage of adding osl function