Added letter loop and exit logic.
Added print statements.