changed split('\r\n') to splitlines()