while not 'moleculetype' in line:
        line = f.readline()
        if not line: break # break out of while if EOF