readded processtrainingdata function