added ability to set objects
simplified logic for setting objects
Merge pull request #1 from segmentio/master

added ability to set objects