Added finding of shortest function