Final submission for the merge

still some cleanup to do.