Added final implementation to deliver, and some clean up