tried to make it faster to no avail. lack of mark/reset on buffered reader is a pain