added leave-one-out cross validation functoinality