added comment
added segment geometry parameters
fixed errors
snapshot
started refactoring