Merge dev branch

Hooray!

@yayalice @bigsley @charlescharles @jcollins1991 @ldevalliere 
Move outer function in