Added mapCells function