segment number fix

fixed math to calculate the correct amount of segments