An optimized return mapping algorithm for the barcelona basic model