added histogram, more code cleanup

also the likelihood equation is just…wrong