Shafferts F7 function implementation