Initial commit of key map algorithm