add makefile
replace std::cin with stdin
fix freeze prediction (?)