Implemented the cliping