quick changes to make it so that it can encode nested structures into perl objects!