some additions made to sed formatting