add the method to calculate the complexities with ret and det.