Example using custom state