reimplemented file cutting part
resovled the conflicts