Added another conditional to decrease runtime.