Reshuffled for layer support, now with better class separation, but not yet exactly right.