added logkow function