refactor some functions. Export chapter marks preview. Problems with timestamp though