Added Support for Maps

Re-added code from old version.