mapBuffer ported and tested