fix 4063: added a check to see if 'objects' exists in data, and if not, refers to 'data' as a single object
fix 4063: optimizing the code, removing code duplicates
fix 4063: added documentation
Merge pull request #80 from MichaelDoron/master

fix 4063