Classy - had to make some changes in assign_layers