implementing more snap.js example