explanation added in comments