change to pure python instead of python + bash