s/N/ARRAY_SZ/
implement version numbers wrapping around (tested successfully with an 8 bit version number)