s-function is working