rewrote the name collision algorithm as Luke was hasseling me