complete rearrange links functionality - fully functional and tested