convert to use bard.js