added stripped down validator code