Converted to new bash function syntax