Added option to set units as a preference.