added a solution to finding the length of the last word