added segment, but it needs debugging
done with segments