the last two seem a little confusing. Maybe some comments/doc-string?