split("\n") can be replaced by splitlines()