Bash script i'm writing because ML doesn't provide an API