changed code to work using bash

Not sure if this causes new problems...