removed subprocess call and replace with python code