clip && trim implemented.