ValidatePath function added

Part of the ValidatePath function implemented