Switched use of object to array for collecting right and left items, to maintain DOM order