some better comments, shorter waiting times, use Popen instead of os.system