added two solutions to reverse words