update with preliminary stuff for databags
Add layer sort
update