Finished splitting in function

To fix:
- Overlapping lectures
- File writing index error