add this logic to a ruby script