add initial support for segment creation

TODO: handle selected segments