Combined code with the duplicate bug in it.