made layer toggling more efficient. Started on tree layer