added lots of changes from std 5311 checkout