added handling TLE and many UI details
UPD: fixed RTE and indentation