changed allocation of N logic