Update automat.cpp

add comments