Added .resize() to adapt canvas size