make scratch function