Changed the sketch logic