minor updates before re-integrating this into the main branch