Removed all use of cat from the script, which may slightly increase performance. It also makes me less of a shitty programmer.