clean up
implement cut function