making the script more generic and updating the readme