implemented smarter algorithm for 2p particle states