The function routine runs successfully on at least the simplest case!!