Finished log file algorithm changing
Seems it work
Need additional testing