added num_layers()