Modified TriBox algorithm to remove unworking steps.