completed example, needs testing and documentation