basic implementation with few keys