new algorithm implementation - draft