custom-range can now be computed based on nbits, fixes #6, fixes #7, fixes #8, needs cosmetic and warnings