As Nic said below, couldn't you use swap here? Also, what's going on here? You're setting crossoverPointMax to be crosseverPointMin, and then crossoverPointMin to be tmp, which is crossoverPointMin.