re-formatting, fixes, split to several files

task8