forward algorithm
update the example assert method