add pmap implematation and tests