first lecture. almost finished, notation needs to be fixed