Added position validator code snippet