State now correctly uses 255 instead of -1