this is a stanford university's lecture notes.