Added @arvestad suggestion, needs further validation, contam_rate still not entirely correct but close