Search engine and adjaceny list code