I didn't understand these conditions... What is the meaning of key=0,1,2? Why not 3?