Made sure that segments dictionary initializes correctly