adding more functionality to sed/text file manipulation script