Created a function of caret