Cleaned up to use bitMath using bit functions