Cleaned up, comments + security critical check

Cleaned up, commented better and added security critical check via
Marshal.ReadByte