cleaned up the contamination code