full code and notes