Updated mapping code