modified the commit in which I added reading

Modified the commit in which I added reading functions, I used the
suggestions from the comments to make it fit in the API style and
improved the code a little