Completed Deploy function