adding martinez alg