added deliver function