Working getused() and made length and mask a property of the buffer rather than defines