modified shortner function