improve graphics.js