How did the civil war affect maine?