added longest word algo