finalizing validation set

some debugging + writing file
Generic Validation function

Validation function works with both sources for validation