added some explanations to non-obvious stuff