changed counting of doubles (again)