Switched to Karols units library. Optimized table lookups.