Got validation for layers working and added some documentation