number of chars per state = 39 instead of 40, removed trailing \n