rework to condense code works for no PML casee... now the PML case to be implimented