might want to make a const, segmentsize

that const might actually already exist