Updated lecture and code