fixed an issue with the python script, also added improved readibility for end user