code updates to v3.1