Rewrote histadd in Python