Cleaned file and added Comments to very compilcated #ifdef .. #endif stuff. Commented also encoding loop.
Commented #ifdef .. #endif stuff so it's more clean to read