Add comments, remove some unnecessary checks.