trying to implement snap.js