modified version of length f last word