refactored deployment.algorithm