algorithm decomposition