tried to fix collision loop
fixed sort looping error