Adds a way to retrieve the number of layers