Updated after lecture notes 1 and 2