initial implementation of bimap