added functionalitity to use complex objects