Commented a method and the if statements out.
Uncommented the new method and the if statements
New query now has a having statement to check for count.
Moved a Function call and the if statement.
Remove function call added to handle duplicates.
Moved a couple of tags
Moved Tags and function calls around
changed an SQL statement
COmmenting out the method call and the if statement.