after two days of desperation I wanted to turn to you now, hoping to solve the problem after all. It sounds simple, but for some reason it is not easy: I want to get a function