wrote short part of code for processing input to separate wrong file (TODO: move)