removed the hacky embeded python from the bash script
changed the conditional to be smarter