Added Imports and safeguards.