Change main function and added histogram output