reduce example code