This has to be improved (really !) with a real complexity computing algorithm