Updated main.

Now logs to a file and distributes the plane name to other threads