Implemented 3 fold crossvalidation for model optimization