added serialization/deserialization, histograms, command line arguments. tested.