initial implementation of mapper function