some code to merge up from master