add spec and conditional for key = size