Added some improvements to the reader.
Added global func, some changes.