Merge for layers

Merging to get Justin's code