} else {

Also please invert the blocks. It seems more logical to have the case with 1 entry at the beginning and the case with 2 entries right after.