fixed the efficiency problem