added swap function to mapCell.m