parses stream; going to add wrapper