read text directly rather than reading from file