Code used for Phase2 sample validation