init
some fixes
all work with std::vector
fix input/output
replace fstream -> stream