fix extraneous open(); add seek() and rstrip()