In `def SecondaryStructure(file1):` there is no need to identify prevStruct in a separate loop. It should be merged into the main loop.