Changed variable names and readsegment.m