Moved the right part of the program from the old version. Slightly reworked the structure.
I decided to rewrite the program taking into account the experience gained.