from lecture notes