added rsplit to remove the newlines