Function splitting into training+validation sets added; Updates to main