fiexed edge cases in item rearranging. probably should refactor everything a little.