Calculate half based on str_ref.
Add my copyright.