Fix for error on line 287

"attmept to index globbal 'elements' (a nil value)" 
Changing "elements" to "self.elements" fixed that.
Merge pull request #6 from Moones/patch-1

Fix for error on line 287