Shouldn't this be switch i { case 0:, etc.?