rewrote remdup to handle all cases now, so now it's independent of the last char