Cleaned up system() call.  use subtitute() to cleanup instead of echo hacks