moved the elements around, per xander
refactored for prototypal inheritence