better complexity