Merged with todd's changes on his branch to master