More style points: instead of `.replace('\n', '')` you can use `.split()`, which will remote all heading and trailing non-printable characters (specifically: spaces, tabs, newlines).