improved node example with tests