basics of generation and detection