Update element.rb

Fixed various issues with scope, the Ruby way of things, etc.
Merge pull request #1 from MiltonStanley/patch-1

Update element.rb