adding functions to commands.js of snippets