Tested with ruby 2.6, but should work with previous versions. Run either ruby script.rb or ruby clustering.rb