finished code explanations