fixed issues with imbedded layers (hopefully), added layer number to stop single layer display. Some other tweaks