Changed MAXV to be a uint16_t