improved basic example