Reversed words algorithm was implemented