better spacing, simpler ifs, bash matching returned