finally got it working! i think it should be correct now. as for base materials, alchemy books are now ignored and do not count as a grass nor will add to other grass rank items in the compound.
here are the rules as for now:
the highest rank base (or combination of multiple ranks of same base) must be the primary base. the other bases can be in any order as opposed to in rank order like I had it before.
also, I put some more useful information in the popup which explains why it is there.
Let me know what you think or if everything looks correct!
EDIT: http://wlodb.com/compounds/5779
just noticed this compound...is this possible to get your first item back if there are no other combinations even if it doesn't match the bases?