Modified Amacomi.search