started reverse string prog
reverse line by line, based on online solution