changed 256 to MAX