reviewed basics through code blocks, some comments for clarity