Using size_t isntead of int for buffer size specifier
fixing the IDX macros to account for offset