Fixed indentation.
Added spaces, changed function name.
Fixed the log when changing windows.
Fixed some warnings.
Updated htaccess about log file.