Replaced global variable MAX_BITS with local variable (with better descriptive name) ptr_size