almost working function F(s)