Added auto log file creation, fixed mistakes.

Made a lot of changes! Check out the changes if you like!