works with list of complex objects