Added the lookup type. Cleanup. Added cloning function.