Working with units algebraically