Merge marian

My attempt at merging Marian's branch.