Core logic of the recorder implemented