added a drawing function to main.js